package cn.home.service.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import cn.home.service.mapper.HomeServiceRecordMapper;
import cn.home.service.domain.HomeServiceRecord;
import cn.home.service.service.IHomeServiceRecordService;

/**
 * 服务记录Service业务层处理
 * 
 * @author xsc
 * @date 2025-04-09
 */
@Service
public class HomeServiceRecordServiceImpl implements IHomeServiceRecordService 
{
    @Autowired
    private HomeServiceRecordMapper homeServiceRecordMapper;

    /**
     * 查询服务记录
     * 
     * @param id 服务记录主键
     * @return 服务记录
     */
    @Override
    public HomeServiceRecord selectHomeServiceRecordById(Long id)
    {
        return homeServiceRecordMapper.selectHomeServiceRecordById(id);
    }

    /**
     * 查询服务记录列表
     * 
     * @param homeServiceRecord 服务记录
     * @return 服务记录
     */
    @Override
    public List<HomeServiceRecord> selectHomeServiceRecordList(HomeServiceRecord homeServiceRecord)
    {
        return homeServiceRecordMapper.selectHomeServiceRecordList(homeServiceRecord);
    }

    /**
     * 新增服务记录
     * 
     * @param homeServiceRecord 服务记录
     * @return 结果
     */
    @Override
    public int insertHomeServiceRecord(HomeServiceRecord homeServiceRecord)
    {
        return homeServiceRecordMapper.insertHomeServiceRecord(homeServiceRecord);
    }

    /**
     * 修改服务记录
     * 
     * @param homeServiceRecord 服务记录
     * @return 结果
     */
    @Override
    public int updateHomeServiceRecord(HomeServiceRecord homeServiceRecord)
    {
        return homeServiceRecordMapper.updateHomeServiceRecord(homeServiceRecord);
    }

    /**
     * 批量删除服务记录
     * 
     * @param ids 需要删除的服务记录主键
     * @return 结果
     */
    @Override
    public int deleteHomeServiceRecordByIds(Long[] ids)
    {
        return homeServiceRecordMapper.deleteHomeServiceRecordByIds(ids);
    }

    /**
     * 删除服务记录信息
     * 
     * @param id 服务记录主键
     * @return 结果
     */
    @Override
    public int deleteHomeServiceRecordById(Long id)
    {
        return homeServiceRecordMapper.deleteHomeServiceRecordById(id);
    }

    @Override
    public List<HomeServiceRecord> selectHomeServiceRecordByUserId(Long userId) {
        List<HomeServiceRecord> homeServiceRecords = homeServiceRecordMapper.selectHomeServiceRecordByUserId(userId);
        return homeServiceRecords;
    }
}
